#include "motor.h"
#include "task.h"

void car_control(uint8_t car_act)
{
	switch (car_act)
	{
		case brake:
			motor_control(0,0,0,0);
		break;
		
		case low_reteat:
			motor_control(500,500,-500,-500);
		break;
		
		case high_reteat:
			motor_control(1000,1000,-1000,-1000);
		break;
		
#ifdef VARIABLE
		case low_advance:
			motor_control(-350,-350,350,350);
		break;
#elif defined UNIFORM
		case low_advance:
			motor_control(-400,-400,400,400);
		break;
#endif		
		
		case middle_advance:
			motor_control(-700,-700,700,700);
		break;
		
		case high_advance:
			motor_control(-1000,-1000,1000,1000);
		break;
			
		case turn_left:
			motor_control(1000,1000,1000,1000);	
		break;
		
		case turn_right:
			motor_control(-1000,-1000,-1000,-1000);	
		break;
		
		case Round_right:
			motor_control(-500,-500,-700,-700);
		break;
		
		case UP_advance:
			motor_control(-500,-500,500,500);
		break;
		
		default:
		break;
			
	}
}
